<!--深度-->
<template>
  <div class="order-cell bg2">

    <div class="row jbetween">
      <div class="row jcenter">
        <div :class="['cell-type', Config.upDownBg(this.item.side=='buy')]"> 
          <text class="font24 text2">{{typeStr}}</text>
        </div>
        <text class="font24 text2">{{'  '+item.counterCoin+'/'+item.baseCoin}}</text>
      </div>

      <div class="but-cancel bk4" @click="$emit('cancel')">
        <text class="font20 text2">{{T('撤销')}}</text>
      </div>
    </div>
    
    <div class="height30"></div>
    <div class="row">
      <div class="column all3">
        <text class="font20 text3">{{T('时间')}}</text>
        <text class="font28 text2">{{item.createTimeStr}}</text>
        <div class="height6"></div>
      </div>

      <div class="column all3">
        <text class="font20 text3">{{T('价格')+'('+item.baseCoin+')'}}</text>
        <div class="height6"></div>
        <text class="font28 text2">{{item.price}}</text>
      </div>
      
      <div class="column all2 aend">
        <text class="font20 text3">{{T('数量')+'('+item.counterCoin+')'}}</text>
        <div class="height6"></div>
        <text class="font28 text2">{{item.amount}}</text>
      </div>
    </div>
    <div class="cell-line bg4"></div>
  </div>
</template>


<script>
import jconfig from "@/_js/config"
import jmath from "@/_js/math"
import jnavigator from "@/_js/navigator"

const weexFunction = weex.requireModule("WeexFunction")
const WeexTrading = weex.requireModule("WeexTrading")
const globalEvent = weex.requireModule('globalEvent');

import I18N from "@/_i18n/i18n";
var T = I18N.t;
export default {

  props:{
    item: Object,
    isContract: {
      type: Boolean,
      default:true
    }
  },

  data() {
    return {
      T:T,
      Config:jconfig,
    };
  },

  mounted() {
    jconfig.init(()=>{
    }, [jconfig.OPT_UP_DOWN]);
  },
  
  computed: {
    typeStr() {
      
      if (!this.isContract) {
        return this.item.side=='buy' ? '买入' : '卖出';
      }

      if (this.item.offset==1) {
        return this.item.side=='buy' ? '开多' : '开空';
      } 

      return this.item.side=='buy' ? '平空' : '平多';
      
    }
  },

  methods: {

    /******************************** 点击 */
  }
};

</script>

<style src="@/_css/style.css" ></style>

<style scoped>
.order-cell{
  flex-direction: column;
  padding: 30px 40px;
}
.cell-type {
  justify-content: center;
  align-items: center;
  height:36px;
  padding-left: 4px;
  padding-right: 4px;
}
.but-cancel {
  justify-content: center;
  align-items: center;
  height:44px;
  border-radius:2px;
  border-width:2px;
  padding-left: 22px;
  padding-right: 22px;
}
.cell-line{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height:1px;
}
</style>